<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		圆的半径:<input type="text" id="input1"/>
		<button onclick="clac()">计算</button>
		<script type="text/javascript">
			console.log("π="+Math.PI);
			
			function clac()
			{
				var r = parseFloat(input1.value)
				var area = Math.PI * r * r;
				alert("圆的面积:"+area);
			}
		</script>
	</body>
</html>
